
import {
  DEFAULT_CLIENT_PORTAL_SETTING
} from '@/components/storybook/settings/design'
import { cloneDeep } from 'lodash'

export default {
  state: {
    clientPortalDesign: DEFAULT_CLIENT_PORTAL_SETTING || {},
    cloneClientPortalDesign: DEFAULT_CLIENT_PORTAL_SETTING || {}
  },

  mutations: {
    setCloneClientPortalDesign (state, design) {
      state.cloneClientPortalDesign = cloneDeep(design)
    },
    setClientPortalDesign (state, design = DEFAULT_CLIENT_PORTAL_SETTING) {
      state.clientPortalDesign = cloneDeep(design)
      state.cloneClientPortalDesign = cloneDeep(design)
    },
    restCloneClientPortalDesign (state) {
      state.clientPortalDesign = cloneDeep(DEFAULT_CLIENT_PORTAL_SETTING)
      state.cloneClientPortalDesign = cloneDeep(DEFAULT_CLIENT_PORTAL_SETTING)
    }
  }

}
